Population class extension: argument handling module

Main script to provide the argument handling class extensions

class binarycpython.utils.population_extensions.argument_handling.argument_handling(**kwargs)[source]

Bases: object

Extension for the Population class containing the code for source-file sampling functions

parse_cmdline()[source]

Function to handle settings values via the command line in the form x=y, w=z, etc.

Best to be called after all the .set(..) lines, and just before the .evolve() is called

If you input any known parameter (i.e. contained in population_options, defaults/bse_options or custom_options), this function will attempt to convert the input from string (because everything is string) to the type of the value that option had before.

The values of the bse_options are initially all strings, but after user input they can change to ints.

The value of any new parameter (which will go to custom_options) will be a string.

Return type

None

set(**kwargs)[source]

Function to set the values of the population. This is the preferred method to set values of functions, as it provides checks on the input.

the bse_options will get populated with all the those that have a key that is present in the self.defaults

the population_options will get updated with all the those that have a key that is present in the self.population_options

If neither of above is met; the key and the value get stored in a custom_options dict.

Parameters
  • parameters (via kwargs all the arguments are either set to binary_c) –

  • custom_options (population_options or) –

Return type

None